package com.kefu.chat.vo;

import cn.hutool.core.bean.BeanUtil;
import com.kefu.chat.model.ChatChannelSideBar;
import com.kefu.common.context.KefuContext;
import com.kefu.common.vo.AbstractUpdateVo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotEmpty;

@Data
public class ChatChannelSideBarUpdateVo extends AbstractUpdateVo<ChatChannelSideBar, String> {
    @NotEmpty
    @ApiModelProperty(value = "主键")
    private String sidebarId;

    /**
     * 渠道id
     */
    @NotEmpty
    @ApiModelProperty(value = "渠道id")
    private String channelId;

    @ApiModelProperty(name = "customContent", value = "客户自定义内容")
    private String customContent;

    @ApiModelProperty(name = "displayField", value = "客服名片显示")
    private String displayField;

    @NotEmpty
    @ApiModelProperty(name = "menuName", value = "菜单名称")
    private String menuName;

    @ApiModelProperty(name = "menuStatus", value = "菜单状态")
    private Integer menuStatus;

    @ApiModelProperty(name = "menuType", value = "菜单类型")
    private Integer menuType;

    @ApiModelProperty(name = "menuUrl", value = "跳转url")
    private String menuUrl;

    @ApiModelProperty(name = "sortNo", value = "排序")
    private Integer sortNo;

    @Override
    public ChatChannelSideBar convert() {
        KefuContext kefuContext = KefuContext.getKefuContext();
        ChatChannelSideBar info = BeanUtil.toBean(this, ChatChannelSideBar.class);
        info.setUpdateTime(kefuContext.getNow());
        info.setUpdateUser(kefuContext.getUserId());
        info.setUpdateName(kefuContext.getUserName());
        return info;
    }
}
